import request from "@/utils/http";

/** 分类列表 */
export const getCategoriesAPI = () => {
	return request({ url: "/category/top" });
}
  

// 获取收货地址列表
export const getAddressAPI = () => {
	return request({
	  url: "/member/address",
	});
};
  
// 添加收货地址
export const addAddressAPI = (data) => {
	return request({
	  url: "/member/address",
	  method: "post",
	  data,
	});
};

// 获取收货地址列表
export const getMemberAddress = (id) => {
	return request({
		url: `/member/address/${id}`,
		
	});
};
  
 
/**
 * 更新收货地址
 */
export const updateAddressAPI = (id, data) => {
	return request({
	  url: `/member/address/${id}`,
	  method: "put",
	  data,
	});
};
  
/**
 * 删除收货地址
 */
export const delAddressAPI = (id) => {
	return request({
	  url: `/member/address/${id}`,
	  method: "delete",
	});
  };